package com.pkk.penguin.frame.know.java.driven.propertiessources;

import com.pkk.penguin.frame.know.java.driven.propertiessources.bean.AppNamepProperty;
import java.lang.annotation.Inherited;
import javax.annotation.Resource;
import javax.annotation.Resources;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Primary;
import org.springframework.core.env.ConfigurableEnvironment;
import org.springframework.core.env.MutablePropertySources;

/**
 * @description: 文件配置的测试
 * @author: peikunkun
 * @create: 2020-08-04 18:00
 **/

@ComponentScan(basePackages = "com.pkk.penguin.frame.know.java.driven.propertiessources")
public class PropertiesSourceMainTest {


  @Test
  public void Administrator_12_20200804180409_() {
    System.out.println("欢迎使用单元测试方法【Administrator_12()_20200804180409】");
    System.out.println("此方法测试描述：【配置配置文件的路径】");
    final AnnotationConfigApplicationContext annotationConfigApplicationContext = new AnnotationConfigApplicationContext(
        PropertiesSourceMainTest.class);
    final AppNamepProperty bean = annotationConfigApplicationContext.getBean(AppNamepProperty.class);
    System.out.println(bean.toString());
    final ConfigurableEnvironment environment = annotationConfigApplicationContext.getEnvironment();
    final String property = environment.getProperty("app.name");
    final MutablePropertySources propertySources = environment.getPropertySources();
  }


}
